/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package org.cedict.dao;

import javax.persistence.EntityManager;
import org.cedict.domain.UTF8CedictRow;
import org.geergenbein.dao.GenericHibernateDAO;

/**
 *
 * @author andrew
 */
public class CedictDAO extends GenericHibernateDAO<UTF8CedictRow, Long> {

    public CedictDAO(EntityManager em) {
        super(em);
    }

    public UTF8CedictRow findByTraditionalAndPinyin(String traditional,
            String pinyin)
    {
        return (UTF8CedictRow) getSession().
                getNamedQuery("findByTraditionalAndPinyin").
                setString("traditionalCharacters", traditional).
                setString("pinyin", pinyin).
                uniqueResult();
    }
}
